<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>省外迁出登记</title>
    <link rel="stylesheet" href="<c:url value="/resource/mobile/css/frozen.css"></c:url>">
    <link type="text/css" rel="stylesheet" href="<c:url value="/resource/mobile/css/weui.css"></c:url>"/>
    <link type="text/css" rel="stylesheet" href="<c:url value="/resource/mobile/css/example.css"></c:url>"/>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resource/mobile/css/main.css"></c:url>"/>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resource/mobile/css/yulan.css"></c:url>"/>
    <link rel="stylesheet" type="text/css" href="<c:url value='/resource/wechat/css/font-awesome.min.css'/>">

    <style>
        .ui-form-item label:not(.ui-switch):not(.ui-checkbox):not(.ui-radio){width: 105px;}
        .ui-form-item input{padding-left: 110px;}
        .ui-form-item input {
            color: #000;
        }

        .ui-form-item-textarea textarea {
            margin-top: 11px;
        }

        /*上传附件*/
        .weui_uploader_bd {
            overflow: inherit;
        }

        .weui_uploader_file {
            position: relative;
        }

        /*下拉框*/
        .ui-form-item > .ui-select {
            margin-left: 92px;
        }
        .shiju_lf{padding-right: 15px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
        }
        .shiju_lf:after{position: absolute;top: 50%;right: 0;margin-top: -4px;width: 0;height: 0;
            border-top: 6px solid;border-right: 5px solid transparent;border-left: 5px solid transparent;
            color: #a6a6a6;content: "";pointer-events: none;}
        .onload {
            background: rgba(0, 0, 0, 0.6);
            width: 50%;
            height: 20%;
            border-radius: 5px;
            color: #fff;
            text-align: center;
            position: fixed; /**定位采用此种方式**/
            left: 50%; /**左边50%**/
            top: 50%; /**顶部50%**/
            margin-top: -100px; /**上移-50%**/
            margin-left: -100px; /**左移-50%**/
            padding-top: 10%;
        }

        .onload p {
            font-size: 16px;
        }

        .success_p1 {
            text-align: center;
            color: #fff;
            background: rgba(32, 30, 30, 0.81);
            line-height: 50px;
            position: fixed; /**定位采用此种方式**/
            left: 50%; /**左边50%**/
            top: 50%; /**顶部50%**/
            margin-top: -100px; /**上移-50%**/
            margin-left: -100px; /**左移-50%**/
            width: 50%;
            border-radius: 5px;
            font-size: 14px;
        }

    </style>
    <script src="<c:url value='/resource/js/jquery-2.0.min.js'/>"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $(".p_row").click(function(){
                $(this).children(".p_row_main").toggleClass("p_row_main_active");
                $(this).next(".clyj_kuai").slideToggle();
                $(this).siblings(".p_row").next(".clyj_kuai").slideUp();
                $(this).siblings(".p_row").children(".p_row_main").removeClass("p_row_main_active");
            });
        })
    </script>
    <script type="text/javascript" src="<c:url value='/resource/mobile/js/example.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/mobile/js/zepto.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/js/jquery.form.min.js'/>"></script>
    <script src="<c:url value='/resource/wechat/js/FormValid.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/mobile/js/main.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/mobile/js/yulan.js'/>"></script>
    <script type="text/javascript" src="https://gaapi.jl.gov.cn/logservice/resource/js/os.analystic-1.4.min.js"></script>
    <script type="text/javascript" src="<c:url value='/resource/mobile/js/layer/layer.js'/>" ></script>

</head>
<body class="body_bg" ontouchstart>
</section>
    <ul class="ul_lost">
        <li>
            <h1 class="h1_text" style="color: #0c72c8; font-size: 16px;margin: 0px 10px; ">省外迁出登记</h1>
        </li>
    </ul>
    <div class="ui-form" style="width: 100%;float: left;">
        <form action="#" id="hzfwForm" method="post">

            <input type="hidden" name="tableName" value="">
            <input type="hidden" name="apptype" value="4">
            <input type="hidden" name="ip" value="">
            <input type="hidden" name="isPrePrj" value="0">
            <input type="hidden" id="pd"/>
            <div class="ui-form-item ui-form-item-show ui-border-b">
                <label for="#">姓名</label>
                <input type="text" value="${aliasNameWjb}" placeholder="请输入" readonly>
            </div>

            <%--<div class="ui-form-item ui-form-item-show ui-border-b">--%>
                <%--<label for="#">身份证号</label>--%>
                <%--<input type="text" value="${member.idCard}" placeholder="请输入" readonly>--%>
            <%--</div>--%>
            <div class="ui-form-item ui-form-item-show ui-border-b">
                <label for="#">手机号码</label>
                <input type="text" value="${telephoneWjb}" placeholder="请输入" readonly>
            </div>
            <div class="ui-form ui-border-t" style="margin-top: -1px;">
                <div class="ui-form-item ui-border-b" id="S1" style="display:block;">
                    <label>审批部门</label>
                    <div class="ui-select">
                        <select id="S" name="" onchange="changeQuYu(this.value);">
                        </select>
                    </div>
                </div>
                <div class="ui-form-item ui-border-b" id="S2" style="display:none;">
                    <label></label>
                    <div class="ui-select">
                        <select id="Q" name="Q" onchange="changePaics(this.value);">
                        </select>
                    </div>
                </div>
                <div class="ui-form-item ui-border-b" id="S3" style="display:none;">
                    <label></label>
                    <div class="ui-select">
                        <select id="P" name="P" >
                        </select>
                    </div>
                </div>
                <input type="hidden" name="size" value="${size}"/>
            </div>

        </form>
    </div>
    <div class="scfj_p">请上传附件材料</div>
<div style="width: 100%;float: left;">
    <div class="weui_cells weui_cells_form" style="margin-top: 0px;">
        <div class="weui_cell">
            <div class="weui_cell_bd weui_cell_primary">
                <div class="weui_uploader">
                    <div class="weui_uploader_hd weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">
                            <span style="color: #ff0000;">*</span>
                            迁入地公安机关签发的《准予迁入证明》</div>
                        <div class="weui_cell_ft"></div>
                    </div>
                    <div class="weui_uploader_bd" style="margin-top: 10px;">
                        <ul class="weui_uploader_files" id="img1">

                        </ul>
                        <div class="weui_uploader_input_wrp" id="pic_1"
                             style="display: block;">
                            <input class="weui_uploader_input" type="file" valid="required"
                                   errmsg="请上传  迁入地公安机关签发的《准予迁入证明》" name="fileName"
                                   id="fileName1"
                                   accept="image/jpg,image/jpeg,image/png,image/gif"
                                   onchange="readFile(this,'1')">
                            <input type="hidden" name="fileValue1"
                                   id="fileValue1"/>

                            <input type="hidden" value="${material.guid}" name="guid1"
                                   id="guid1"/>
                            <input type="hidden" value="${material.rownum}" name="sort1"
                                   id="sort1"/>
                            <input type="hidden" value="${material.ismust}" name="must1"
                                   id="must1"/>
                            <input type="hidden" value="${material.material}" name="material1"
                                   id="material1"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div style="width: 100%;float: left;">
    <div class="weui_cells weui_cells_form" style="margin-top: 0px;">
        <div class="weui_cell">
            <div class="weui_cell_bd weui_cell_primary">
                <div class="weui_uploader">
                    <div class="weui_uploader_hd weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">

                            <span style="color: #ff0000;">*</span>
                            居民户口薄</div>
                        <div class="weui_cell_ft"></div>
                    </div>
                    <div class="weui_uploader_bd" style="margin-top: 10px;">
                        <ul class="weui_uploader_files" id="img2">

                        </ul>
                        <div class="weui_uploader_input_wrp" id="pic_2"
                             style="display: block;">
                            <input class="weui_uploader_input" type="file" valid="required"
                                   errmsg="请上传  居民户口薄" name="fileName"
                                   id="fileName2"
                                   accept="image/jpg,image/jpeg,image/png,image/gif"
                                   onchange="readFile(this,'2')">
                            <input type="hidden" name="fileValue2"
                                   id="fileValue2"/>

                            <input type="hidden" value="${material.guid}" name="guid2"
                                   id="guid2"/>
                            <input type="hidden" value="${material.rownum}" name="sort2"
                                   id="sort2"/>
                            <input type="hidden" value="${material.ismust}" name="must2"
                                   id="must2"/>
                            <input type="hidden" value="${material.material}" name="material2"
                                   id="material2"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    <div class="scfj_p scfj_p1">材料邮寄<a style="color: #F80000;" id="zfsm">（资费说明）</a> </div>
    <div class="yelh_clyj">
        <form id="addEMS"  method="post">
        <div class="p_row">
            <div class="p_row_main">EMS上门取件</div>
        </div>
        <div class="clyj_kuai">
            <div class="clyj_row">
                <div class="clyj_row_main">
                    <div class="clyj_row_lf" id="qjsm" onclick="changeMark1();"></div>
                    <div class="clyj_row_rt">邮寄人员上门收取申报材料送至办件受理部门</div>
                </div>
            </div>
            <div class="ui-form" style="width: 100%;float: left;padding-left:15px;box-sizing: border-box;">
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>上门收件联系人</label>
                        <input type="text" name="jjrxm" id="jjrxm" value="${member.realName}">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>上门收件电话</label>
                        <input type="number" name="jjrdh1" id="jjrdh1" max="11" maxlength="11" value="${member.mobile}">
                    </div>
                    <div class="ui-form ui-border-t" style="margin-top: -1px;">
                            <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;" id="spbm1">
                                <label>上门收件地址</label>
                                <div class="jl_sj">
                                    <div class="shiju_lf" style="padding-right: 10px;" id="tjxdz_xzdq11">吉林省长春市南关区</div>
                                </div>
                            </div>
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>详细地址</label>
                        <input type="text" id="jdetail" value="">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>上门收件邮编</label>
                        <input type="number" name="jjryb" maxlength="6" value="" id="smyb">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>办理地点</label>
                        <input type="text" name="bldd" id="jarea" value="${caseInfo.toPlace}" readonly="readonly">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>联系电话</label>
                        <input type="text" name="bldh" id="jtel" value="${caseInfo.servicePhone}" readonly="readonly">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;background: #fff;">
                        <label>业务事项名称</label>
                        <input type="text" name="bjmc" value="${caseInfo.caseName}" readonly="readonly">
                    </div>
                    <input type="hidden" name="jjrjd" id="jjrjd"/>
            </div>
            <div class="ywlh_xiala" id="ul_spbm11" style="top: 176px;">
                <ul class="xl_ul_yelh">
                    <div class="xl_ul_top">
                        <li class="ul_top_li11">请选择</li>
                        <li><div class="ul_top_li22">请选择</div></li>
                        <li><div class="ul_top_li33">请选择</div></li>
                    </div>
                    <div class="ul_spbm1_li11" id="select1">

                    </div>
                </ul>

                <ul class="xl_ul_qx1 ul_spbm1_li22" id="select2">

                </ul>

                <ul class="xl_ul_qx1 ul_spbm1_li33" id="select3">

                </ul>
            </div>
        </div>
        <div class="p_row">
            <div class="p_row_main">EMS送件上门</div>
        </div>
        <div class="clyj_kuai">
            <div class="clyj_row">
                <div class="clyj_row_main">
                    <div class="clyj_row_lf" id="sjsm" onclick="changeMark2();"></div>
                    <div class="clyj_row_rt">邮寄人员上门将颁发的证据或许可资料送至申报人</div>
                </div>
            </div>
            <div class="ui-form" style="width: 100%;float: left;padding-left:15px;box-sizing: border-box;">
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>送件上门联系人</label>
                        <input type="text" name="sjrxm" id="sjrxm" value="${member.realName}">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>送件上门电话</label>
                        <input type="number" name="sjrdh1" id="sjrdh1" max="11" maxlength="11"  value="${member.mobile}">
                    </div>
                    <div class="ui-form ui-border-t" style="margin-top: -1px;">
                            <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;" id="spbm2">
                                <label>送件上门地址</label>
                                <div class="jl_sj">
                                    <div class="shiju_lf" style="padding-right: 10px;" id="tjxdz_xzdq111">吉林省长春市南关区</div>
                                </div>
                            </div>
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>详细地址</label>
                        <input type="text" id="sdetail" value="">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>送件上门邮编</label>
                        <input type="number" name="sjryb" maxlength="6" value="" id="sjyb">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>办理地点</label>
                        <input type="text"  id="sarea" value="${caseInfo.toPlace}" readonly="readonly">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;">
                        <label>联系电话</label>
                        <input type="text" id="stel" value="${caseInfo.servicePhone}" readonly="readonly">
                    </div>
                    <div class="ui-form-item ui-form-item-show ui-border-b" style="font-size: 14px;padding-left: 0px;background: #fff;">
                        <label>业务事项名称</label>
                        <input type="text"  value="${caseInfo.caseName}" readonly="readonly">
                    </div>
                    <input type="hidden" name="sjrjd" id="sjrjd"/>
            </div>
            <div class="ywlh_xiala" id="ul_spbm12" style="top: 176px;">
                <ul class="xl_ul_yelh">
                    <div class="xl_ul_top">
                        <li class="ul_top_li111">请选择</li>
                        <li><div class="ul_top_li222">请选择</div></li>
                        <li><div class="ul_top_li333">请选择</div></li>
                    </div>
                    <div class="ul_spbm1_li111" id="select11">
                    </div>
                </ul>
                <ul class="xl_ul_qx1 ul_spbm1_li222" id="select22">

                </ul>

                <ul class="xl_ul_qx1 ul_spbm1_li333" id="select33">
                </ul>
            </div>
        </div>
            <input type="hidden" name="status" id="status"/>
            <input type="hidden" name="projectId" id="projectId">
            <input type="hidden" name="bjsbbh" value="${caseInfo.caseNo}">
        </form>
    </div>
    <div class="ui-btn-wrap">
        <button class="ui-btn-lg ui-btn-primary" id="report" onclick="submit()">
            提交
        </button>
    </div>
    <!--弹出框-->
    <div class="yelh_pop photosDemo">
        <div class="yelh_pop_main">
            <p>EMS温馨提示：</p>
            <p>1.申请人自愿选择EMS快递服务并承担相应费用；</p>
            <p>2.证照类单程邮费：云南省内同城12元，云南省内16元，云南省外18元；<br />
                双向邮寄：云南省内同城24元，云南省内32元，云南省外根据当地实际收费标准收取；</p>
            <p>3.申请人在填写快递单时，请在备注栏处填写受理编号；</p>
            <p>4.如邮件丢失、资料泄漏、邮件逾期等情况处理详见EMS官网：<br/>www.11183.com.cn;</p>
            <p>5.详情咨询EMS客服电话11183。</p>
        </div>
    </div>

</section>
<script>
    var open =  layer.open({
        type: 1,                                    //0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
        shift: 1,//动画    0-6     css3动画
        closeBtn: 1,                                //关闭按钮  0 不显示  style  1和2  标题为 false 2
        title:['资费说明','background:#e9f7f9;color:#3a6c9d;text-align: left;font-size:15px;font-weight: bold;'],
        area: ['80%', '70%'], //宽高
        shadeClose:true,
        content: $(".photosDemo")//iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
    });

    $("#zfsm").on("click",function(){

        var open =  layer.open({
            type: 1,                                    //0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
            shift: 1,//动画    0-6     css3动画
            closeBtn: 1,                                //关闭按钮  0 不显示  style  1和2  标题为 false 2
            title:['资费说明','background:#e9f7f9;color:#3a6c9d;text-align: left;font-size:15px;font-weight: bold;'],
            area: ['80%', 'auto'], //宽高
            shadeClose:true,
            content: $(".photosDemo") //iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
        });
    });
    $(function () {
        var _html = "<option value=''>请选择</option>";
        _html += "<option >昆明市</option>";
        _html += "<option >曲靖市</option>";
        _html += "<option >昭通市</option>";
        _html += "<option >玉溪市</option>";
        _html += "<option >楚雄州</option>";
        _html += "<option >红河州</option>";
        _html += "<option >文山州</option>";
        _html += "<option >普洱市</option>";
        _html += "<option >版纳州</option>";
        _html += "<option >大理州</option>";
        _html += "<option >德宏州</option>";
        _html += "<option >保山市</option>";
        _html += "<option >丽江市</option>";
        _html += "<option >怒江州</option>";
        _html += "<option >迪庆州</option>";
        _html += "<option >临沧市</option>";
        $("#S").empty();
        $("#S").prepend(_html);
    });


    var root=null;
    var province_node1=null;
    var province_node2=null;
    var selecttext222=null;
    var selecttext2222=null;
    var selecttext333=null;
    var selecttext3333=null;
    var mark1=0;
    var mark2=0;
    $(function(){
        <%--var address="${member.address}";--%>
        var unit = "";
        var guid = "";
        var mobile = "";
        var array = "云南省昆明市五华区";
        var name="";
        var areaname="";
        for(var i=0;i<array.length;i++){
            if(array[i]!=""){
                name+=array[i];
                areaname=areaname+array[i]+",";
            }
        }
        $("#tjxdz_xzdq11").html(name);
        $("#tjxdz_xzdq111").html(name);
        $("#sjrjd").val(areaname);
        $("#jjrjd").val(areaname);
        var url="<c:url value='/resource/mobile/js/Area.xml'/>";
        var xmlDoc = null;
        xmlDoc = jQuery.get(url, function (date) {
            root = jQuery(date).find("address")[0];
            $(root).children("province").each(function (i,v) {
                $("#select1").append("<li value='"+i+"'>"+$(this).attr("name")+"</li>");
                $("#select11").append("<li value='"+i+"'>"+$(this).attr("name")+"</li>");
            })
            selecttext222 = $('.ul_top_li11');
            var selectmain222 = $('.ul_spbm1_li11');
            var lis=selectmain222.find('li');
            for(var i=0;i<lis.length;i++)
            {
                lis[i].onclick=function(){
                    var textval222 = $(this).html();
                    selecttext222.text(decodeURIComponent(textval222));
                    var index=$(this).attr("value");
                    getCity(index);
                }
            }
            $(".ul_spbm1_li11 > li").click(function(){
                $(".ul_spbm1_li11").animate({left:'-100%'});
                $(".ul_spbm1_li22").animate({left:'0'});
                $(".ul_top_li22").css("display","block");
                $(".ul_top_li11").css("color","#000");

            })
            $(".ul_top_li11").click(function(){
                $(".ul_spbm1_li11").animate({left:'0'});
                $(".ul_spbm1_li22").animate({left:'100%'});
                $(".ul_spbm1_li33").animate({left:'100%'});
                $(".ul_top_li33").css("color","#000");
                $(".ul_top_li11").css("color","#F80000");
                $(".ul_top_li22").css("color","#000");

            });
             selecttext2222 = $('.ul_top_li111');
            var selectmain2222 = $('.ul_spbm1_li111');
            var lis=selectmain2222.find('li');
            for(var i=0;i<lis.length;i++)
            {
                lis[i].onclick=function(){
                    var textval2222 = $(this).html();
//							selectmain.hide();
                    selecttext2222.text(decodeURIComponent(textval2222));
                    var index=$(this).attr("value");
                    getCity2(index);
                }
            }
            $(".ul_spbm1_li111 > li").click(function(){
                $(".ul_spbm1_li111").animate({left:'-100%'});
                $(".ul_spbm1_li222").animate({left:'0'});
                $(".ul_top_li222").css("display","block");
                $(".ul_top_li111").css("color","#000");
            });
            $(".ul_top_li111").click(function(){
                $(".ul_spbm1_li111").animate({left:'0'});
                $(".ul_spbm1_li222").animate({left:'100%'});
                $(".ul_spbm1_li333").animate({left:'100%'});
                $(".ul_top_li333").css("color","#000");
                $(".ul_top_li111").css("color","#F80000");
                $(".ul_top_li222").css("color","#000");

            });

        });
        //根据省查找市
        function getCity(index){
            $("#select2").empty();
            province_node1 =  $(root).children("province")[parseInt(index)];
            $(province_node1).children("city").each(function (i,v) {
                $("#select2").append("<li value='"+i+"'>"+$(this).attr("name")+"</li>");
            })
            selecttext333 = $('.ul_top_li22');
            var selectmain333 = $('.ul_spbm1_li22');
            var lis=selectmain333.find('li');
            for(var i=0;i<lis.length;i++)
            {
                lis[i].onclick=function(){
                    var textval333 = $(this).html();
//							selectmain.hide();
                    selecttext333.text(decodeURIComponent(textval333));
                    var index=$(this).attr("value");
                    getCountry(index);
                }
            }
            $(".ul_spbm1_li22 > li").click(function(){
                $(".ul_spbm1_li22").animate({left:'-100%'});
                $(".ul_spbm1_li33").animate({left:'0'});
                $(".ul_top_li33").css("display","block");
                $(".ul_top_li22").css("color","#000");
            });
            $(".ul_top_li22").click(function(){
                $(".ul_spbm1_li22").animate({left:'0'});
                $(".ul_spbm1_li33").animate({left:'100%'});
                $(".ul_spbm1_li11").animate({left:'100%'});
                $(".ul_top_li33").css("color","#000");
                $(".ul_top_li11").css("color","#000");
                $(".ul_top_li22").css("color","#F80000");
            });

        }
        //根据城市查找县
        function getCountry(index){
            $("#select3").empty();
            var city_node = $(province_node1).children("city")[parseInt(index)];
            $(city_node).children("country").each(function () {
                $("#select3").append("<li value='"+i+"'>"+$(this).attr("name")+"</li>");
            })
            var selecttext444 = $('.ul_top_li33');
            var selecttext555 = $('#tjxdz_xzdq11');
            var selectmain444 = $('.ul_spbm1_li33');
            var lis=selectmain444.find('li');
            for(var i=0;i<lis.length;i++)
            {
                lis[i].onclick=function(){
                    var textval444 = $(this).html();
//							selectmain.hide();
                    selecttext444.text(decodeURIComponent(textval444));
                    selecttext555.text(decodeURIComponent(selecttext222.html() +selecttext333.html() + textval444));
                    $("#jjrjd").val(selecttext222.html()+","+selecttext333.html()+","+ textval444+",");

                }
            }
            $(".ul_spbm1_li33 > li").click(function(){
                $(".ywlh_xiala").slideUp();
                $(".ul_top_li33").css("color","#000");

            });
            $(".ul_top_li33").click(function(){
                $(".ul_spbm1_li33").animate({left:'0'});
                $(".ul_spbm1_li22").animate({left:'-100%'});
                $(".ul_spbm1_li11").animate({left:'-100%'});
                $(".ul_top_li33").css("color","#F80000");
                $(".ul_top_li11").css("color","#000");
                $(".ul_top_li22").css("color","#000");
            });
        }
        function getCity2(index){
            $("#select22").empty();
            province_node2 =  $(root).children("province")[parseInt(index)];
            $(province_node2).children("city").each(function (i,v) {
                $("#select22").append("<li value='"+i+"'>"+$(this).attr("name")+"</li>");
            })
             selecttext3333 = $('.ul_top_li222');
            var selectmain3333 = $('.ul_spbm1_li222');
            var lis=selectmain3333.find('li');
            for(var i=0;i<lis.length;i++)
            {
                lis[i].onclick=function(){
                    var textval3333 = $(this).html();
//							selectmain.hide();
                    selecttext3333.text(decodeURIComponent(textval3333));
                    var index=$(this).attr("value");
                    getCountry2(index);
                }
            }
            $(".ul_spbm1_li222 > li").click(function(){
                $(".ul_spbm1_li222").animate({left:'-100%'});
                $(".ul_spbm1_li333").animate({left:'0'});
                $(".ul_top_li333").css("display","block");
                $(".ul_top_li222").css("color","#000");
            });
            $(".ul_top_li222").click(function(){
                $(".ul_spbm1_li222").animate({left:'0'});
                $(".ul_spbm1_li333").animate({left:'100%'});
                $(".ul_spbm1_li111").animate({left:'100%'});
                $(".ul_top_li333").css("color","#000");
                $(".ul_top_li111").css("color","#000");
                $(".ul_top_li222").css("color","#F80000");
            });
        }
        //根据城市查找县
        function getCountry2(index){
            $("#select33").empty();
            var city_node = $(province_node2).children("city")[parseInt(index)];
            $(city_node).children("country").each(function () {
                $("#select33").append("<li value='"+i+"'>"+$(this).attr("name")+"</li>");
            })
            var selecttext4444 = $('.ul_top_li333');
            var selecttext5555 = $('#tjxdz_xzdq111');
            var selectmain4444 = $('.ul_spbm1_li333');
            var lis=selectmain4444.find('li');
            for(var i=0;i<lis.length;i++)
            {
                lis[i].onclick=function(){
                    var textval4444 = $(this).html();
//							selectmain.hide();
                    selecttext4444.text(decodeURIComponent(textval4444));
                    selecttext5555.text(decodeURIComponent(selecttext2222.html() +selecttext3333.html() + textval4444));
                    $("#sjrjd").val(selecttext2222.html()+"," +selecttext3333.html()+","+ textval4444+",");
                }
            }
            $(".ul_spbm1_li333 > li").click(function(){
                $(".ywlh_xiala").slideUp();
                $(".ul_top_li333").css("color","#000");
            });
            $(".ul_top_li333").click(function(){
                $(".ul_spbm1_li333").animate({left:'0'});
                $(".ul_spbm1_li222").animate({left:'-100%'});
                $(".ul_spbm1_li111").animate({left:'-100%'});
                $(".ul_top_li333").css("color","#F80000");
                $(".ul_top_li111").css("color","#000");
                $(".ul_top_li222").css("color","#000");
            });
        }
    });

    $(document).ready(function () {
        $(".sxsb_close").click(function () {
            $(this).parent("li").css("display", "none");
        });
    })

    function readFile(obj, index) {
        var file = obj.files[0];
        //判断类型是不是图片
        if (!/image\/\w+/.test(file.type)) {

            $("#fileValue" + index).val("");
            obj.outerHTML = obj.outerHTML.replace(/(value=\").+\"/i, "$1\"");
            fail("请确保文件为图像类型");
            return false;
        }
        for (var i = 0; i < 1; i++) {
            var file = obj.files[i];
            var url = null;
            if (window.createObjectURL != undefined) {
                url = window.createObjectURL(file);
            } else if (window.URL != undefined) {
                url = window.URL.createObjectURL(file);
            } else if (window.webkitURL != undefined) {
                url = window.webkitURL.createObjectURL(file);
            }
            $('#img' + index).empty();
            $('#img' + index).append("<li class='weui_uploader_file' ><img width='79px' height='79px' onclick='showDtetail(\"" + url + "\")' src='" + url + "'/><div class='sxsb_close' onclick='doRemovePic(\"" + index + "\");'></div></li>");
            $("#pic_" + index).css("display", "none");
        }
    };

    function changeQuYu(id) {

        $("#S3").hide();
        //id:代表市局ID
        var _html = "<option >请选择</option>";
        if(id=="昆明市"){
            _html += "<option >五华区</option>";
            _html += "<option >盘龙区</option>";
            _html += "<option >官渡区</option>";
            _html += "<option >西山区</option>";
            _html += "<option >呈贡区</option>";
            _html += "<option >晋宁区</option>";
            _html += "<option >东川区</option>";
            _html += "<option >安宁市</option>";
            _html += "<option >富民县</option>";
            _html += "<option >嵩明县</option>";
            _html += "<option >宜良县</option>";
            _html += "<option >石林彝族自治县</option>";
            _html += "<option >寻甸回族彝族自治县</option>";
            _html += "<option >禄劝彝族苗族自治县</option>";
            $("#Q").empty();
            $("#Q").prepend(_html);
            $("#S2").show();
        }
        else{
            _html ="";
            $("#Q").empty();
            $("#Q").prepend(_html);
            $("#S2").hide();
        }
    }
    function changePaics(id) {

        var _html = "<option>请选择</option>";
        if(id=='五华区'){
            _html += "<option >五华区马村派出所</option>";
            _html += "<option >五华区茭菱派出所</option>";
            _html += "<option >五华区丰宁派出所</option>";
            _html += "<option >五华区黑林铺派出所</option>";
            _html += "<option >五华区王家桥派出所</option>";
        }else
        if(id=='盘龙区') {
            _html += "<option >盘龙区小坝派出所</option>";
            _html += "<option>盘龙区东华派出所</option>";
            _html += "<option >盘龙区穿金路派出所</option>";
            _html += "<option>盘龙区龙头街派出所</option>";
            _html += "<option >盘龙区双龙派出所</option>";
        }else
        if(id=='官渡区') {
            _html += "<option >官渡区金马派出所</option>";
            _html += "<option>官渡区凉亭派出所</option>";
            _html += "<option >官渡区吴井派出所</option>";
            _html += "<option>官渡区关上派出所</option>";
            _html += "<option >官渡区春城路派出所</option>";
        }else
        if(id=='西山区') {
            _html += "<option >西山区团结派出所</option>";
            _html += "<option>西山区刘家营派出所</option>";
            _html += "<option >西山区前卫派出所</option>";
            _html += "<option>西山区谷律派出所</option>";
            _html += "<option >西山区山冲派出所</option>";
            _html += "<option >西山区马鞍山派出所</option>";
            _html += "<option >西山区向阳派出所</option>";
            _html += "<option >西山区湖滨派出所</option>";
            _html += "<option >西山区金牛派出所</option>";
            _html += "<option >西山区明朗派出所</option>";
            _html += "<option >西山区西华派出所</option>";
        }else
        if(id=='呈贡区') {
            _html += "<option >呈贡区城关派出所</option>";
            _html += "<option>呈贡区龙街派出所</option>";
            _html += "<option >呈贡区吴家营派出所</option>";
            _html += "<option>呈贡区石龙湖派出所</option>";
            _html += "<option >呈贡区雨花派出所</option>";
        }else
        if(id=='晋宁区') {
            _html += "<option >晋宁县二街派出所</option>";
            _html += "<option>晋宁县宝峰派出所</option>";
            _html += "<option >晋宁县双河派出所</option>";
            _html += "<option>晋宁县夕阳派出所</option>";
            _html += "<option >晋宁县上蒜派出所</option>";
        }else
        if(id=='安宁市') {
            _html += "<option >安宁市县街派出所</option>";
            _html += "<option>安宁市禄脿派出所</option>";
            _html += "<option >安宁市青龙派出所</option>";
            _html += "<option>安宁市草铺派出所</option>";
            _html += "<option >安宁市温泉派出所</option>";
        }else
        if(id=='富民县') {
            _html += "<option >富民县赤就派出所</option>";
            _html += "<option>富民县款庄派出所</option>";
            _html += "<option >富民县东村派出所</option>";
            _html += "<option>富民县散旦派出所</option>";
            _html += "<option >富民县城关派出所</option>";
        }else
        if(id=='嵩明县') {
            _html += "<option >嵩明县嵩阳派出所</option>";
            _html += "<option>嵩明县杨桥派出所</option>";
            _html += "<option >嵩明县小街派出所</option>";
            _html += "<option>嵩明县牛栏江派出所</option>";
            _html += "<option >嵩明县小新街派出所</option>";
        }else
        if(id=='宜良县') {
            _html += "<option >宜良县柴石滩派出所</option>";
            _html += "<option>宜良县匡远派出所</option>";
            _html += "<option >宜良县蓬莱派出所</option>";
            _html += "<option>宜良县古城派出所</option>";
            _html += "<option >宜良县耿家营派出所</option>";
        }else
        if(id=='石林彝族自治县') {
            _html += "<option >石林县岔口派出所</option>";
            _html += "<option>石林县板桥派出所</option>";
            _html += "<option >石林县大可派出所</option>";
            _html += "<option>石林县长湖派出所</option>";
            _html += "<option >石林县圭山派出所</option>";
        }else
        if(id=='寻甸回族彝族自治县') {
            _html += "<option >寻甸县仁德派出所</option>";
            _html += "<option>寻甸县塘子派出所</option>";
            _html += "<option >寻甸县七星派出所</option>";
            _html += "<option>寻甸县河口派出所</option>";
            _html += "<option >寻甸县功山派出所</option>";
        }else
        if(id=='禄劝彝族苗族自治县') {
            _html += "<option >禄劝县崇德派出所</option>";
            _html += "<option>禄劝县翠华派出所</option>";
            _html += "<option >禄劝县九龙派出所</option>";
            _html += "<option>禄劝县转龙派出所</option>";
            _html += "<option >禄劝县乌蒙派出所</option>";

        }else{
            _html="";
        }
        if(_html==""){
            $("#P").empty();
            $("#P").prepend(_html);
            $("#S3").hide();
        }else{
            $("#P").empty();
            $("#P").prepend(_html);
            $("#S3").show();
        }


    }


    function doRemovePic(obj, attrId, id) {
        $(obj).parent("li").remove();
        var fid = $("#id_" + id).val();
        var fidArray = fid.split(",")
        for (var i = 0; i < fidArray.length; i++) {
            if (fidArray[i] == attrId) {
                num = i;
            }
        }
        fidArray.splice(num, 1);
        var newFid = fidArray.join(",")
        $("#id_" + id).val(newFid)
        $("#del_" + id).val(attrId);
        var num = document.getElementById('img_' + id).children.length;
        if (num <= 2) {
            $("#pic_" + id).css("display", "block");
        }
        if (num == 0) {
            $("#picture_" + id).val("");
        }
    }
    function changeMark1(){
        $("#qjsm").toggleClass("clyj_row_lf_active");
        if(jQuery("#qjsm").attr("class").indexOf("clyj_row_lf_active")>0){
            mark1=1;
        }else{mark1=0;}
    }
    function changeMark2(){
        $("#sjsm").toggleClass("clyj_row_lf_active");
        if(jQuery("#sjsm").attr("class").indexOf("clyj_row_lf_active")>0){
            mark2=1;
        }else{mark2=0;}
    }
    function submit() {
//        if ($("#S").val() == "") {
//            fail("请选择审批部门！");
//            return;
//        }
//        if ($("#Q").val() == "") {
//            fail("请选择审批部门！");
//            return;
//        }
//        var P = $("#P").val();
//        var Q = $("#Q").val();
//        if ($("#pd").val() == 1) {
//            $("#orgId").val(P);
//        } else {
//            $("#orgId").val(Q);
//        }
//        if ($("#orgId").val() == "") {
//            succ("请选择审批部门！");
//            return;
//        }
//        var city = $("#S").val();
//        var county = $("#Q").val();
//        var region = $("#P").val();
//        if(jQuery("#qjsm").attr("class").indexOf("clyj_row_lf_active")>0){
//            mark1=1;
//            if($("#jdetail").val()==""){
//                fail("请输入上门取件详细地址！");
//                return;
//            }
//            if($("#smyb").val()==""){
//                fail("请输入上门取件邮编");
//                return;
//            }
//            var area=$("#jjrjd").val()+$("#jdetail").val();
//            $("#jjrjd").val(area);
//        }else{mark1=0;}
//        if(jQuery("#sjsm").attr("class").indexOf("clyj_row_lf_active")>0){
//            mark2=1;
//            if($("#sdetail").val()==""){
//                fail("请输入办结取件详细地址！");
//                return;
//            }
//            if($("#sjyb").val()==""){
//                fail("请输入办结取件邮编");
//                return;
//            }
//            var area=$("#sjrjd").val()+$("#sdetail").val();
//            $("#sjrjd").val(area);
//        }else{mark2=0;}
//        if(mark1==1){
//            if($("#jdetail").val()==""){
//                fail("请输入上门取件详细地址！");
//                return;
//            }
//            if($("#smyb").val()==""){
//                fail("请输入上门取件邮编");
//                return;
//            }else{
//                if($("#smyb").val().length>6){
//                    fail("请输入正确上门取件邮编");
//                    return;
//                }
//            }
//            if($("#jjrxm").val()==""){
//                fail("请输入上门取件人姓名");
//                return;
//            }
//            if($("#jjrdh1").val()==""){
//                fail("请输入上门取件电话");
//                return;
//            }
//            else{
//                if($("#jjrdh1").val().length>11){
//                    fail("请输入正确的上门取件电话");
//                    return;
//                }
//            }
//            var area=$("#jjrjd").val()+$("#jdetail").val();
//            $("#jjrjd").val(area);
//        }
//        if(mark2==1){
//            if($("#sdetail").val()==""){
//                fail("请输入送件上门详细地址！");
//                return;
//            }
//            if($("#sjyb").val()==""){
//                fail("请输入送件上门邮编");
//                return;
//            }else{
//                if($("#sjyb").val().length>6){
//                    fail("请输入正确的送件上门邮编");
//                    return;
//                }
//            }
//            if($("#sjrxm").val()==""){
//                fail("请输入送件上门人姓名");
//                return;
//            }
//            if($("#sjrdh1").val()==""){
//                fail("请输入送件上门电话");
//                return;
//            }else{
//                if($("#sjrdh1").val().length>11){
//                    fail("请输入正确的送件上门电话");
//                    return;
//                }
//            }
//            var area=$("#sjrjd").val()+$("#sdetail").val();
//            $("#sjrjd").val(area);
//        }
//        if(mark1==1&&mark2==1){
//            $("#status").val(2);
//        }else if(mark1==1&&mark2==0){
//            $("#status").val(0);
//        }else if(mark1==0&&mark2==1){
//            $("#status").val(1);
//        }

        alert("申报成功")
        window.location.href="<c:url value="/weixin/wx_member/index"/>";
    }
</script>
<script type="text/javascript" src="<c:url value='/resource/mobile/js/ems.js'/>"></script>
</body>

</html>